home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, motion, location, row, undercard
- global foundation, getlist, equal, currentsel, godlist, points, stock, tableau, extras
-
- on beginSprite me
- if not listp(foundation) then
- foundation = [:]
- end if
- row = determinerow()
- foundation.addProp(row, new(script("card pile")))
- location = sprite(spriteNum).loc
- undercard = sprite(spriteNum - 8)
- end
-
- on mouseDown me
- if foundation[row].getcardcount() > 0 then
- if spriteNum = foundation[row].getlastcard().spnum then
- puppetSound(3, member("pick card", "100GPak Generic SFX"))
- sprite(spriteNum).locZ = spriteNum + 1000
- getlist = foundation[row]
- motion = timeout(string(spriteNum) && "motion").new(5, #moving, me)
- end if
- if foundation[row].getcardcount() > 1 then
- undercard.member = member(foundation[row].cards[foundation[row].getcardcount() - 1].membername, "playing cards")
- end if
- end if
- end
-
- on moving me
- if the mouseDown then
- sprite(spriteNum).loc = the mouseLoc
- else
- if the mouseUp then
- sprite(spriteNum).locZ = spriteNum
- motion.forget()
- abort()
- end if
- end if
- end
-
- on mouseUp me
- if equal then
- puppetSound(3, member("pick card", "100GPak Generic SFX"))
- sprite(currentsel).member = member(sprite(spriteNum).member.name, "playing cards")
- sprite(spriteNum).member = member("empty", "playing cards")
- godlist.addCard(currentsel)
- sprite(spriteNum).loc = location
- foundation[row].cards.deleteOne(foundation[row].getlastcard())
- if not objectp(foundation[sprite(currentsel).row]) then
- points = points - 10
- end if
- equal = 0
- currentsel = 0
- godlist = VOID
- getlist = VOID
- repeat with i = 93 to 96
- if tableau[sprite(i).row].getcardcount() = 0 then
- next repeat
- end if
- sprite(i).loc = tableau[sprite(i).row].getlastcard().location
- end repeat
- checkwin()
- else
- if not equal then
- puppetSound(3, member("drop card", "100GPak Generic SFX"))
- getlist = VOID
- sprite(spriteNum).loc = location
- end if
- end if
- end
-
- on determinerow me
- if spriteNum = 77 then
- return #fone
- else
- if spriteNum = 78 then
- return #ftwo
- else
- if spriteNum = 79 then
- return #fthree
- else
- if spriteNum = 80 then
- return #ffour
- else
- if spriteNum = 81 then
- return #ffive
- else
- if spriteNum = 82 then
- return #fsix
- else
- if spriteNum = 83 then
- return #fseven
- else
- if spriteNum = 84 then
- return #feight
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-